/* RMIServer.java 
* Created on Dec 13, 2012 
*@Author: Mr.Viet 
*@Phone: 01683430426 
*@Email: phamvanvietcdhd@gmail.com
*/ 
package com.session8; 

import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

public class RMIServer {

	public RMIServer() {
	}

	public static void main(String[] args) {
		try {
			Registry reg = LocateRegistry.createRegistry(2014);
			GateWayIml g = new GateWayIml();
			IGateWay stub = (IGateWay)UnicastRemoteObject.exportObject(g,0);
			reg.rebind("xxx", stub);
			System.out.println("Server is running...");
		} catch (RemoteException e) {
			e.printStackTrace();
		}	
	}

}
